package cn.stylefeng.guns.modular.transport.mapper;

import cn.stylefeng.guns.modular.order.model.params.OrderTransportParam;
import cn.stylefeng.guns.modular.transport.entity.TransportDispatch;
import cn.stylefeng.guns.modular.transport.entity.ZhuangyunMingxiTongji;
import cn.stylefeng.guns.modular.transport.entity.peisongfenxi;
import cn.stylefeng.guns.modular.transport.model.params.TransportDispatchParam;
import cn.stylefeng.guns.modular.transport.model.params.TransportReceiptParam;
import cn.stylefeng.guns.modular.transport.model.result.TransportDispatchResult;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * 调度单表 Mapper 接口
 */
public interface TransportDispatchMapper extends BaseMapper<TransportDispatch> {

    /**
     * 获取列表
     */
    List<TransportDispatchResult> customList(@Param("paramCondition") TransportDispatchParam paramCondition);

    /**
     * 获取map列表
     */
    List<Map<String, Object>> customMapList(@Param("paramCondition") TransportDispatchParam paramCondition);

    /**
     * 获取分页实体列表
     */
    Page<TransportDispatchResult> customPageList(@Param("page") Page page, @Param("paramCondition") TransportDispatchParam paramCondition, @Param("condition") String condition,@Param("param2")TransportReceiptParam param2);
    
    Page<TransportDispatchResult> findPpPageBySpec(@Param("page") Page page, @Param("paramCondition") TransportDispatchParam paramCondition, @Param("condition") String condition,@Param("operateId")Long operateId);

    /**
     * 获取分页map列表
     */
    Page<Map<String, Object>> customPageMapList(@Param("page") Page page, @Param("paramCondition") TransportDispatchParam paramCondition);

	List<TransportDispatchResult> findCarListBySpec(@Param("paramCondition")TransportDispatchParam param, @Param("getUnit")String getUnit
			, @Param("getLocation")String getLocation, @Param("token")String token,@Param("carState")String carState);

	List<TransportDispatchResult> findAutoPrintByDispatchNumber(@Param("dispatchNumber")String dispatchNumber);


	List<TransportDispatchResult> findDispatchListBySpec(@Param("paramCondition")TransportDispatchParam param, @Param("token")String token);

	List<TransportDispatchResult> findgoodslistBySpec(@Param("paramCondition")TransportDispatchParam param, @Param("getUnit")String getUnit, @Param("getLocation")String getLocation, @Param("token")String token,@Param("carState")String carState);

	TransportDispatchResult findBySpec(@Param("paramCondition")TransportDispatchParam param);

	Integer findgoodslistNottransportNumber(@Param("paramCondition")TransportDispatchParam tdp, @Param("token")String token);

	List<TransportDispatchResult> findCarListBySpecToo(@Param("paramCondition")TransportDispatchParam param, @Param("getUnit")String getUnit, @Param("getLocation")String getLocation,
			@Param("token")String token,@Param("carState")String carState,@Param("dispatch")String dispatch,@Param("operateId")Long operateId);

	List<TransportDispatchResult> findCarListBySpecToo2(@Param("paramCondition")TransportDispatchParam param, @Param("getUnit")String getUnit, @Param("getLocation")String getLocation,
													   @Param("token")String token,@Param("carState")String carState,@Param("dispatch")String dispatch,@Param("operateId")Long operateId);

	List<TransportDispatchResult> findCarListBySpecToo4(@Param("paramCondition")TransportDispatchParam param, @Param("getUnit")String getUnit, @Param("getLocation")String getLocation,
			@Param("token")String token,@Param("carState")String carState,@Param("dispatch")String dispatch,@Param("operateId")Long operateId);

	List<TransportDispatchResult> findCarListBySpecYunShuZhongToo(@Param("paramCondition")TransportDispatchParam param,
			@Param("token")String token,@Param("carState")String carState,@Param("dispatch")String dispatch,@Param("operateId")Long operateId);

	Page<TransportDispatchResult> findCarListBySpecToo2Page(@Param("page")Page page,@Param("paramCondition")TransportDispatchParam param, @Param("getUnit")String getUnit, @Param("getLocation")String getLocation,
			@Param("token")String token,@Param("carState")String carState,@Param("dispatch")String dispatch,@Param("operateId")Long operateId);

	Page<TransportDispatchResult> findCarPageListBySpecToo(@Param("page")Page page,@Param("paramCondition")TransportDispatchParam param, @Param("getUnit")String getUnit, @Param("getLocation")String getLocation,
			@Param("token")String token,@Param("carState")String carState,@Param("dispatch")String dispatch,@Param("operateId")Long operateId);

    List<TransportDispatchResult> findgoodslist(@Param("paramCondition")TransportDispatchParam orderTransportParam);

	List<TransportDispatchResult> findListBySpec(@Param("paramCondition")TransportDispatchParam param);

	List<TransportDispatchResult> findListByCarIsNull(@Param("paramCondition")TransportDispatchParam param);

	List<TransportDispatchResult> findOrderListBySpec(@Param("paramCondition")TransportDispatchParam param, @Param("token")String token, @Param("operateId")Long operateId);

	List<TransportDispatchResult> findOrderListBySpecNew(@Param("paramCondition")TransportDispatchParam param, @Param("token")String token, @Param("operateId")Long operateId);

	void updateDispatchNumber(@Param("paramCondition")TransportDispatchParam param,@Param("operateId")Long operateId);

	List<TransportDispatchResult>  findbydispatchmumber(@Param("paramCondition")TransportDispatchParam orderTransportParam);

	List<TransportDispatchResult> sumBySpec(@Param("paramCondition")TransportDispatchParam param, @Param("getUnitId")Long getUnitId, @Param("getLocationId")Long getLocationId);

	List<TransportDispatchResult> findNotByCarnumber(@Param("paramCondition")TransportDispatchParam param);

	Page<TransportDispatchResult> findCarListBySpecTooPage(@Param("page")Page page, @Param("paramCondition")TransportDispatchParam param, @Param("dispatch")String dispatch, @Param("operateId")Long operateId);

	List<TransportDispatchResult> findPrintlistSpec(@Param("paramCondition")TransportDispatchParam param, @Param("param2")TransportReceiptParam param2);

	List<ZhuangyunMingxiTongji> findchengyunshangMingxiCount(@Param("paramCondition")TransportDispatchParam param
			,@Param("condition")String condition,@Param("getUnit")String getUnit,@Param("times")String times
			,@Param("operateId")Long operateId,@Param("operateId2")Long operateId2);

	Page<ZhuangyunMingxiTongji> findchengyunshangMingxiPage(@Param("page")Page page,@Param("paramCondition")TransportDispatchParam param
			,@Param("condition")String condition,@Param("getUnit")String getUnit,@Param("times")String times
			,@Param("operateId")Long operateId,@Param("operateId2")Long operateId2);

	List<ZhuangyunMingxiTongji> findchengyunshangMingxiAll(@Param("paramCondition")TransportDispatchParam param
			,@Param("condition")String condition,@Param("getUnit")String getUnit,@Param("times")String times
			,@Param("operateId")Long operateId,@Param("operateId2")Long operateId2);
	
	List<ZhuangyunMingxiTongji> findchengyunshangGetUnitCount(@Param("paramCondition")TransportDispatchParam param
			,@Param("condition")String condition,@Param("getUnit")String getUnit,@Param("times")String times
			,@Param("operateId")Long operateId,@Param("operateId2")Long operateId2);

	Page<ZhuangyunMingxiTongji> findchengyunshangGetUnitCountPage(@Param("page")Page page,@Param("paramCondition")TransportDispatchParam param
			,@Param("condition")String condition,@Param("getUnit")String getUnit,@Param("times")String times
			,@Param("operateId")Long operateId,@Param("operateId2")Long operateId2);

	Page<ZhuangyunMingxiTongji> findCarrierRecDetailPage(@Param("page")Page page,@Param("paramCondition")TransportDispatchParam param
			,@Param("condition")String condition,@Param("getUnit")String getUnit,@Param("times")String times
			,@Param("operateId")Long operateId,@Param("operateId2")Long operateId2);

	List<ZhuangyunMingxiTongji> findCarrierRecDetailAll(@Param("paramCondition")TransportDispatchParam param
			,@Param("condition")String condition,@Param("getUnit")String getUnit,@Param("times")String times
			,@Param("operateId")Long operateId,@Param("operateId2")Long operateId2);

	Page<ZhuangyunMingxiTongji> findCarrierRecFeePage(@Param("page")Page page,@Param("paramCondition")TransportDispatchParam param
			,@Param("condition")String condition,@Param("times")String times
			,@Param("operateId")Long operateId,@Param("operateId2")Long operateId2);

	Page<ZhuangyunMingxiTongji> findTmpCarAppExa(@Param("page")Page page,@Param("paramCondition")TransportDispatchParam param
			,@Param("condition")String condition,@Param("times")String times
			,@Param("operateId")Long operateId,@Param("operateId2")Long operateId2);

	Page<ZhuangyunMingxiTongji> findTmpCarTb(@Param("page")Page page,@Param("paramCondition")TransportDispatchParam param
			,@Param("condition")String condition,@Param("times")String times
			,@Param("operateId")Long operateId,@Param("operateId2")Long operateId2);

	List<ZhuangyunMingxiTongji> findCarrierRecFeeAll(@Param("paramCondition")TransportDispatchParam param
			,@Param("condition")String condition,@Param("times")String times
			,@Param("operateId")Long operateId,@Param("operateId2")Long operateId2);

	List<ZhuangyunMingxiTongji> getYunFei(@Param("paramCondition")TransportDispatchParam param,@Param("times")String times
			,@Param("operateId")Long operateId);

	List<ZhuangyunMingxiTongji> getYunFeiByCarrier(@Param("paramCondition")TransportDispatchParam param,@Param("times")String times
			,@Param("operateId")Long operateId);

	TransportDispatchResult findBySpecNotEqId(@Param("paramCondition")TransportDispatchParam param);

	TransportDispatchResult sumBySpec2(@Param("paramCondition")OrderTransportParam param, @Param("getLocationId")Long getLocationId);

	TransportDispatchResult findBySpecNotEqCustomerOrder(@Param("paramCondition")TransportDispatchParam param);

	TransportDispatchResult findBySpecDispatchNumberIsnull(@Param("paramCondition")TransportDispatchParam param);

	TransportDispatchResult findByCarIsNull(@Param("paramCondition")TransportDispatchParam param,@Param("operateId")Long operateId);

	List<TransportDispatchResult> findgoodslistBySpecWeb(@Param("paramCondition")TransportDispatchParam transportDispatchParam, @Param("token")String token, @Param("operateId")Long operateId);

	List<peisongfenxi> findPeisongfenxi(@Param("paramCondition")TransportDispatchParam param
			,@Param("condition")String condition,@Param("getUnit")String getUnit,@Param("times")String times,@Param("operateId")Long operateId,@Param("operateId2")Long operateId2);

	Page<peisongfenxi> findPeisongfenxiPage(@Param("page")Page page,@Param("paramCondition")TransportDispatchParam param
			,@Param("condition")String condition,@Param("getUnit")String getUnit,@Param("times")String times,@Param("operateId")Long operateId,@Param("operateId2")Long operateId2);

	List<TransportDispatchResult> findListBySpecXianggui(@Param("paramCondition")TransportDispatchParam param);

	List<TransportDispatchResult> findPrintlistBySpec(@Param("paramCondition")TransportReceiptParam transportReceiptParam);

	TransportDispatchResult sumMatrixingNumberByCarrierId(@Param("paramCondition")TransportDispatchParam dispatchParam);

	List<ZhuangyunMingxiTongji> findPeisongjindu(@Param("paramCondition")TransportDispatchParam transportDispatchParam, @Param("condition")String condition,
			@Param("times")String times, @Param("operateId")Long operateId, @Param("operateId2")Long operateId2);

	List<TransportDispatchResult> findClListBySpec(@Param("paramCondition")TransportDispatchParam clParam);

	List<TransportDispatchResult> findCarListBySpecYunShuZhongTooGetUnit(@Param("paramCondition")TransportDispatchParam transportDispatchParam,
			@Param("dispatch")String dispatch, @Param("operateId")Long operateId);

	List<TransportDispatchResult> findLineListBySpec(@Param("paramCondition")TransportDispatchParam transportDispatchParam, @Param("token")String token,
			@Param("operateId")Long operateId);

	List<TransportDispatchResult> findLineListBySpecNew(@Param("paramCondition")TransportDispatchParam transportDispatchParam, @Param("token")String token,
													 @Param("operateId")Long operateId);


	List<TransportDispatchResult> findLineGetUnitListBySpecNew(@Param("paramCondition")TransportDispatchParam transportDispatchParam, @Param("token")String token,
														@Param("operateId")Long operateId);



	List<TransportDispatchResult> findGetUnitListBySpec(@Param("paramCondition")TransportDispatchParam transportDispatchParam, @Param("token")String token,
			@Param("operateId")Long operateId);

	Integer countGetUnit(@Param("paramCondition")TransportDispatchParam countppp);

	List<TransportDispatchResult> findSumGoodsBySpec(@Param("paramCondition")TransportDispatchParam transportDispatchParam);

	TransportDispatchResult findClZjSumBySpec(@Param("dispatchNumber")String dispatchNumber);

	List<TransportDispatchResult> findHxprintListBySpec(@Param("paramCondition")TransportDispatchParam transportDispatchParam);

	List<TransportDispatchResult> findHxLmAssociationOrder(@Param("paramCondition")TransportDispatchParam transportDispatchParam);

	List<TransportDispatchResult> findHxAutoPrintListBySpec(@Param("paramCondition")TransportDispatchParam transportDispatchParam);

	TransportDispatchResult findClZjunitSumBySpec(@Param("dispatchNumber")String dispatchNumber, @Param("getLocationId")Long getLocationId);

	TransportDispatchResult findClZjunitSumPrintBySpec(@Param("dispatchNumber")String dispatchNumber, @Param("getLocationId")Long getLocationId);

	List<TransportDispatchResult> findByCustOrderIds(@Param("idList") List<String> idList);
}
